﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Odyssey.Linq;

namespace Odyssey.Web.Areas.Admin.Models
{
    public class ViewHelper
    {
        public static List<tb_module> GetSubModule(List<tb_module> modules, string parentid)
        {
            return modules.Where(item => item.ParentModule == parentid).ToList();
        }

        public static List<tb_subclass> GetSubClasses(List<tb_subclass> subclasses, int pareintId)
        {
            return subclasses.Where(item => item.parentid == pareintId).ToList();
        }

        public static List<tb_left_navigation> GetChildNavigaitnos(List<tb_left_navigation> subNavigations, int pareintId)
        {
            return subNavigations.Where(item => item.parent.GetValueOrDefault() == pareintId).ToList();
        }
    }
}